package top.laoshuzi.designpatterns.base.created.abstract_factory;

import org.junit.Test;

public class Client {

    @Test
    public void operation() {

        //创建工厂
        Factory factoryA = FactoryManager.createFactory(FactoryManager.TYPE_FACTORY_A);
        Factory factoryB = FactoryManager.createFactory(FactoryManager.TYPE_FACTORY_B);

        //创建产品
        System.out.println(factoryA.makeProduct1().getName());
        System.out.println(factoryA.makeProduct2().getName());
        System.out.println(factoryA.makeProduct3().getName());

        System.out.println(factoryB.makeProduct1().getName());
        System.out.println(factoryB.makeProduct2().getName());
        System.out.println(factoryB.makeProduct3().getName());

    }

}
